#include "timer.h"
#include "uni_hal_timer.h"
#include "rtthread.h"

#define TIMER_PRINT(format, ...)	 		rt_kprintf("616:%s %d:"format, __FUNCTION__, __LINE__, ##__VA_ARGS__)

TIMER_ERROR_CODE uni_hal_timer_init(TIMER_INDEX TimerIdx,unsigned int usec,timer_cb cb)
{
	TIMER_ERROR_CODE ret;
	ret = timer_Config(TimerIdx,usec,cb);
	if(ret != TIMER_ERROR_OK){
		TIMER_PRINT("uni_hal_timer_init failed\n");
		return ret;
	}
	return ret;
}
TIMER_ERROR_CODE uni_hal_timer_start(TIMER_INDEX TimerIdx)
{
	return enable_timer(TimerIdx); 
}

TIMER_ERROR_CODE uni_hal_timer_pause(TIMER_INDEX TimerIdx)
{
	return disable_timer(TimerIdx);
}
